<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var miniConsole=(function () {
        var cache = [];
        var handler = function (e) {
            if(e.keyCode===38){
                var script = document.createElement('script');
                script.onload = function () {
                    for (var i =0,fn;fn=cache[i++];){
                        fn()
                    }
                };
                script.src='miniConsole.js';
                document.getElementsByTagName('head')[0].appendChild(script);
                document.body.removeEventListener('keydown',handler);
            }
        };
        document.body.addEventListener('keydown',handler,false);
        return {
            log:function () {
                var args = arguments;
                cache.push(function () {
                    return miniConsole.log.apply(miniConsole,args);
                })
            }
        }
    })();
    miniConsole.log(1,2,3,4,5,6,7,8);
</script>
</body>
</html>